class User < ActiveRecord::Base

	has_one :board_post
	has_one :board_comment

	validates_presence_of :login_id,:name,:password
	validates_uniqueness_of :login_id
	validates_length_of 	:password,
				:minimum => 3,
				:message=> "should be at leat 3 char. long"

	def self.auth(login_id,password)
		self.find_by_login_id_and_password(login_id,password)
	end
	
end
